COMPILE_INSTALL_PATH=/opt/online_judge/compile_server
OJ_INSTALL_PATH=/opt/online_judge/oj_server

.PHONY: all
all:
	@cd compile_server;\
	make;\
	cd -;\
	cd oj_server;\
	make;\
	cd -;

.PHONY:install 
install:
	@mkdir -p $(COMPILE_INSTALL_PATH);\
	mkdir -p $(OJ_INSTALL_PATH);\
	cp compile_server/compile_server $(COMPILE_INSTALL_PATH);\
	cp -rf compile_server/temp $(COMPILE_INSTALL_PATH);\
	\
	cp oj_server/oj_server $(OJ_INSTALL_PATH);\
	cp -rf oj_server/conf $(OJ_INSTALL_PATH);\
	cp -rf oj_server/questions $(OJ_INSTALL_PATH);\
	cp -rf oj_server/template_html $(OJ_INSTALL_PATH);\
	cp -rf oj_server/wwwroot $(OJ_INSTALL_PATH);\

.PHONY:clean
clean:
	@cd compile_server;\
	make clean;\
	cd -;\
	cd oj_server;\
	make clean;\
	cd -;\
	rm -rf $(COMPILE_INSTALL_PATH);\
	rm -rf $(OJ_INSTALL_PATH);